package com.example.demo.domain;

// DifyWorkflowRunResult.java
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public class DifyWorkflowRunResult {
    @JsonProperty("task_id")
    private String taskId;
    @JsonProperty("workflow_run_id")
    private String workflowRunId;
    private Data data;

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getWorkflowRunId() {
        return workflowRunId;
    }

    public void setWorkflowRunId(String workflowRunId) {
        this.workflowRunId = workflowRunId;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }
// Getters and setters for taskId, workflowRunId, data

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Data {
        private String id;
        @JsonProperty("workflow_id")
        private String workflowId;
        private String status;
        private Map<String, String> outputs; // outputs 可能包含多个键值对，这里简化为Map<String, String>
        private String error;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getWorkflowId() {
            return workflowId;
        }

        public void setWorkflowId(String workflowId) {
            this.workflowId = workflowId;
        }

        public Map<String, String> getOutputs() {
            return outputs;
        }

        public void setOutputs(Map<String, String> outputs) {
            this.outputs = outputs;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getError() {
            return error;
        }

        public void setError(String error) {
            this.error = error;
        }
// Getters and setters for id, workflowId, status, outputs, error
        // ... (其他字段如 elapsed_time, total_tokens 等)
    }
}
